<?php 

$dossierId=$currentObject->dossierid;
$datearrive=$currentObject->datearrive;

$SQL="SELECT
count (*) as cnt
FROM
cabinet_soins
WHERE
cabinet_soins.dossierId = $dossierId and cabinet_soins.date > $datearrive";
$rs=ew_LoadRecordset($SQL);

$result=$rs->fields["cnt"];

if ($result=="")
{
	?>
	
	
	<script>

	$("#cabinet_attente_datearrive").parent().hide();
	</script>
	<?php 
	
}
?>
<td>
<?php 


$SQL="SELECT
cabinet_rendezvous.prochainrendezvous_temp
FROM
cabinet_rendezvous
WHERE
cabinet_rendezvous.dossierId = $dossierId AND
YEAR(cabinet_rendezvous.prochainrendezvous) = YEAR(NOW()) and MONTH(cabinet_rendezvous.prochainrendezvous) = MONTH(NOW()) and DAY(cabinet_rendezvous.prochainrendezvous) = DAY(NOW()) ";
$rs=ew_LoadRecordset($SQL);

$result=$rs->fields["prochainrendezvous_temp"];

$rendezvous="Matin";
if (formatDate($currentObject->datearrive, "Y-m-d H:i:s", "H")>13) $rendezvous="Apres Midi";
$color="#339966";
if ($result==$rendezvous) $color="#FF0000"; 

?>

<div class="workflow_status" style="background-color:<?=$color?>"></div>
</td>
